// 用户管理 接口 (对应 swagger的 内部创建用户)

// 拼接url
const concatUrl = (url) => window.RPConfig.admin + url

// 列表查询
export const queryUserList = (params) => $http.post(concatUrl('actIdUser/selectList'), params)

// 新增用户
export const addUser = (params) => $http.post(concatUrl('actIdUser/insert'), params)

// 修改用户
export const updateUser = (params) => $http.post(concatUrl('actIdUser/update'), params)

// 删除用户
export const deleteUser = (params) => $http.post(concatUrl('actIdUser/delete'), params)

//用户组列表
export const userGroupList = (params) => $http.post(concatUrl('group/queryGroupPageList'), params)

//添加用户组
export const addUserGroup = (params) => $http.post(concatUrl('group/saveGroup'), params)

//修改用户组
export const editUserGroup = (params) => $http.post(concatUrl('group/update'), params)

//删除用户组
export const delUserGroup = (params) => $http.post(concatUrl(`group/delete/${params.id}`), params)

//用户组详情
// export const userGroupDetails = (params) => $http.post(concatUrl(`/group/detail/${params.id}`), params)

//给组批量添加人
export const addUsersToGroup = (params) => $http.post(concatUrl('group/addUsersToGroup'), params)

//用户组下的人员
export const userGroupPerson = (params) => $http.post(concatUrl('group/queryActIdUserPageListOfGroup'), params)

//批量删除用户组的人
export const delUserGroupPeople = (params) => $http.post(concatUrl('group/delUsersOfGroup'), params)

//角色列表查询
export const roleList = (params) => $http.post(concatUrl('group/queryRolePageList'), params)

//新增角色
export const addRole = (params) => $http.post(concatUrl('group/saveRole'), params)

//查询所有菜单树
export const queryAllMenu = (params) => $http.post(concatUrl(`group/queryAllMenuWithSelected/${params.id}`), params)

//给角色批量添加菜单
export const addRoleMenu = (params) => $http.post(concatUrl('group/addMenusToRoleFirstDel'), params)

//一个角色下未选中的资源
export const unChosedResource = (params) => $http.post(concatUrl('Resource/selectListByRoleIdNotChoose'), params)

//一个角色下未选中的资源
export const chosedResource = (params) => $http.post(concatUrl('Resource/selectListByRoleIdChoose'), params)

//批量插入一个角色下的资源
export const insertResource = (params) => $http.post(concatUrl('Resource/addResourceIdsToGroup'), params)

//批量删除一个角色下的资源
export const deleteResource = (params) => $http.post(concatUrl('Resource/delResourceIdsOfGroup'), params)